import recordIndex from './recordIndex'
import recordList from './recordList'

const recordRouter = {

  path: 'system/recordIndex',
  getChildRoutes(nextState, cb) {
    require.ensure([], (require) => {
      cb(null, [
        {
          path: 'list',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, recordList)
            })
          },

        },
      ])
    })
  },
  indexRoute: {
    getComponents(location, cb) {
      require.ensure([], function (require) {
        cb(null, recordList)
      })
      return cb()
    }
  },

  getComponents(nextState, cb) {
    require.ensure([], (require) => {
      cb(null, recordIndex)
    })
  }
}

export default recordRouter;

